<?php


namespace app\common\service;
use Driver\Cache\Redis;

class getRedis
{
    # 获取redis所有的keys
    public function getAllKeys()
    {
        $keys = Redis::getAllKeys();
        return [
            'keys' => $keys
        ];
    }
    # string操作 根据key获取对应的value
    public function getValue($key)
    {
        $string = Redis::getValue($key);
        return $string;
    }
    # hash操作 获取某个hash表所有字段名。hash表不存在时返回空数组
    public function getAllHash($key)
    {
        $data = Redis::getAllHash($key);
        return $data;
    }
    # set 获取k所有set
    public function getAllSet($key)
    {
        $data = Redis::getAllSet($key);
        return $data;
    }

    public function delKey($key)
    {
        $data = Redis::DelKey($key);
        return $data;
    }

    # 获取所有的list
    public function getAllList($key)
    {
        $data = Redis::getAllList($key);
        return $data;
    }
}